#!/usr/bin/python3
# -*- coding: utf-8 -*-

from selenium.webdriver.common.by import By
from pages.BasePage import BasePage

class BaiduPage(BasePage):
	"""
	在这里写定位器，通过元素属性定位元素对象
	"""
	url = "https://www.baidu.com"
	search_loc = (By.XPATH, '//*[@id="kw"]')  # 定位百度文本框
	click_btn = (By.XPATH, '//*[@id="su"]')  # 定位百度按钮

	def open_page(self):
		self.get(self.url)

	def input_baidu_text(self, text):
		self.send_key(self.search_loc, text)

	def click_baidu_btn(self):
		self.click(self.click_btn)
